package com.game.service.beans;

import com.game.service.app.get_score.Money;
import com.game.service.app.get_score.UserLoginInfo;
import com.game.service.beans.game.Position;
import com.game.service.beans.game.Weapon;

public class UserInfo {
    //个人信息
    private String name;//玩家昵称
    private int uid;//玩家ID
    private long score;//玩家携带分数
    private Money money;//保存的是原始获取分数,结算时需要返回给服务器
    private String mac;//机器码
    private int liveid;//主播房间
    private String stream;//主播场次
    private String platform;//用户哪端进入
    private long commission;//主播佣金
    private UserLoginInfo userLoginInfo;//用户登录信息
    private int status;

    //比赛信息
    private int defender; //1为左边,2为右边==重要信息！！！
    private String tableId; //桌子ID
    private int prepare; //准备状态,0未准备,1准备,
    private int hp;//玩家血量
    private Position uPos;//玩家的位置
    private int lifes;//生命数量
    private int lossHp;//本次损失血量
    private Weapon weapon;

    public void reset() {
        this.defender = 0;
        this.tableId = "";
        this.prepare = 1;
        this.hp = 0;
        this.uPos = new Position();
        this.lifes = 0;
        this.lossHp = 0;
        this.weapon = new Weapon();
    }

    public static final int UNPREPARED = 1;
    public static final int PREPARED = 0;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getUid() {
        return uid;
    }

    public void setUid(int id) {
        this.uid = id;
    }

    public long getScore() {
        return score;
    }

    public void setScoreLower(long score) {
        this.score -= score;
    }

    public void setScoreAdd(long score) {
        this.score += score;
    }

    public void setScore(long score) {
        this.score = score;
    }

    public Money getMoney() {
        return money;
    }

    public void setMoney(Money money) {
        this.money = money;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public int getLiveid() {
        return liveid;
    }

    public void setLiveid(int liveid) {
        this.liveid = liveid;
    }

    public String getStream() {
        return stream;
    }

    public void setStream(String stream) {
        this.stream = stream;
    }

    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    public long getCommission() {
        return commission;
    }

    public void setCommission(long commission) {
        this.commission = commission;
    }

    public UserLoginInfo getUserLoginInfo() {
        return userLoginInfo;
    }

    public void setUserLoginInfo(UserLoginInfo userLoginInfo) {
        this.userLoginInfo = userLoginInfo;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getTableId() {
        return tableId;
    }

    public void setTableId(String tableId) {
        this.tableId = tableId;
    }

    public int getPrepare() {
        return prepare;
    }

    public void setPrepare(int prepare) {
        this.prepare = prepare;
    }

    public int getDefender() {
        return defender;
    }

    public void setDefender(int defender) {
        this.defender = defender;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public Position getuPos() {
        return uPos;
    }

    public void setuPos(Position uPos) {
        this.uPos = uPos;
    }

    public Weapon getWeapon() {
        return weapon;
    }

    public void setWeapon(Weapon weapon) {
        this.weapon = weapon;
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "name='" + name + '\'' +
                ", uid=" + uid +
                ", score=" + score +
                ", money=" + money +
                ", mac='" + mac + '\'' +
                ", liveid=" + liveid +
                ", stream='" + stream + '\'' +
                ", platform='" + platform + '\'' +
                ", commission=" + commission +
                ", userLoginInfo=" + userLoginInfo +
                ", status=" + status +
                ", tableId=" + tableId +
                ", prepare=" + prepare +
                ", defender=" + defender +
                ", hp=" + hp +
                ", uPos=" + uPos +
                ", weapon=" + weapon +
                '}';
    }

    public int getLifes() {
        return lifes;
    }

    public void setLifes(int lifes) {
        this.lifes = lifes;
    }

    public void setCommissionAdd(long commission) {
        this.commission += commission;
    }

    public int getLossHp() {
        return lossHp;
    }

    public void setLossHp(int lossHp) {
        this.lossHp = lossHp;
    }
}
